/*
 * Created: 2022-08-25 19:28:50
 * Author : 涛涛涛
 */

import React, { useContext } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ProductItemContext } from '@/pages/Home/ProductList/ProductItem/ProductItemContext';
// 人民币:¥  日元:￥
export interface IProps extends ICompProps {}
Price.defaultProps = {} as Partial<IProps>;
function Price(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('Price', className);
    const { price } = useContext(ProductItemContext);
    return (
        <RootView className={localClassName} style={style}>
            <Text className="iconfont">¥</Text>
            <Text>{price}</Text>
        </RootView>
    );
}
export default React.memo(Price);
const RootView = styled(View)`
    .iconfont {
        font-size: 14px;
    }
    &.Price {
        font-size: 54px;
        color: #ff8828;
        line-height: 54px;
        font-weight: bold;
    }
`;
